package com.wang.service;

import com.wang.mapper.UserDao;

import com.wang.pojo.User;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserServiceImpl extends BaseServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public User selectUserByUserName(String userName) {
        return userDao.selectUserByUserName(userName);
    }

    @Override
    public User selectUserByUserPhone(String userPhone) {
        return userDao.selectUserByUserPhone(userPhone);
    }

    @Override
    public User selectUserByWeichatId(String userWeichatId) {
        return userDao.selectUserByWeichatId(userWeichatId);
    }

    @Override
    public void updateLoginTime(Integer userId, String userLastLogin) {
        userDao.updateLoginTime(userId, userLastLogin);
    }

    @Override
    public User selectUserByUserId(Integer userId) {
        return userDao.selectUserByUserId(userId);
    }

    @Override
    public void addUser(User user) {
        userDao.addUser(user);
    }

    @Override
    public void editUserPhone(Integer userId, String userPhone) {
        userDao.editUserPhone(userId, userPhone);
    }

    @Override
    public void perfectionUserInfo(Integer userId, String userCompany, String userEmail, String userNearName) {
        userDao.perfectionUserInfo(userId, userCompany, userEmail, userNearName);
    }

    @Override
    public void editUserInfo(User user) {
        userDao.editUserInfo(user);
    }


    @Override
    public void bindUserWeixinId(User user) {
        userDao.bindUserWeixinId(user);
    }

    @Override
    public User selectUserByUserNameAndMd5UserPass(String userName, String md5UserPass) {
        return userDao.selectUserByUserNameAndMd5UserPass(userName, md5UserPass);
    }

    @Override
    public void uEditUserNearName(Integer userId, String userNearName) {
        userDao.uEditUserNearName(userId, userNearName);
    }

    @Override
    public void uEditUserCompany(Integer userId, String userCompany) {
        userDao.uEditUserCompany(userId, userCompany);
    }

    @Override
    public List<Integer> selectAllUserId() {
        return userDao.selectAllUserId();
    }

    @Override
    public void editMyEmail(Integer userId, String userEmail) {
        userDao.editMyEmail(userId, userEmail);
    }

    @Override
    public void updateUserPassByUserPhone(String userPhone, String newUserPass) {
        userDao.updateUserPassByUserPhone(userPhone, newUserPass);
    }

    @Override
    public User selectUserByWeichatIdAndUserName(String userName, String userWeichatId) {
        return userDao.selectUserByWeichatIdAndUserName(userName, userWeichatId);
    }

    @Override
    public List<User> selectByDevId(Integer devId) {
        return userDao.selectByDevId(devId);
    }


}
